<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<script src="../echarts.min.js"></script>
		<script type="text/javascript" src="../addressIP.js"></script>
		<script type="text/javascript" src="../easyUI/jquery.min.js"></script>
		<script type="text/javascript" src="../easyUI/jquery.easyui.min.js"></script>
		<style type="text/css">
			* {
				margin: 0;
				padding: 0;
			}
			.main {
				width: 100%;
				height: 100%;
				position: absolute;
			}
			.quarter-div {
				width: 50%;
				height: 100%;
				float: left;
			}
		</style>
		<title></title>
	</head>
	<body>
		<div class="main">
			<div class="quarter-div" id="left"></div>
			<div class="quarter-div" id="right"></div>
		</div>
		<script type="text/javascript">
			// 基于准备好的dom，初始化echarts实例
			var myChart = echarts.init(document.getElementById('left'));
			var names=[];
			var values=[];
			$.ajax({
				type: 'GET',
				url: addressip+"/Top",
				//请求成功
				success: function(result) {
					if (!result) {
						alert("null");
					} else {
						for (i = 0; i < result.length; i++) {
							names.push(result[i].name);
							values.push(result[i].value);
						}
						option = {
							title:{
								text:"本月签到次数排名"
							},
							xAxis: {
								type: 'category',
								data: names
							},
							yAxis: {
								type: 'value'
							},
							series: [{
								data: values,
								type: 'bar'
							}]
						};


						// 使用刚指定的配置项和数据显示图表。
						myChart.setOption(option);
					};
			}
			});
			
		</script>
	<script type="text/javascript">
		// 基于准备好的dom，初始化echarts实例
		var myChart1 = echarts.init(document.getElementById('right'));
		var name1=[];
		var value1=[];
		$.ajax({
			type: 'GET',
			url: addressip+"/TopCore",
			//请求成功
			success: function(result) {
				if (!result) {
					alert("null");
				} else {

					for (i = 0; i < result.length; i++) {
						name1.push(result[i].name);
						value1.push(result[i].value);
					}
					option = {
						title:{
							text:"本月签到积分排行"
						},
						xAxis: {
							type: 'category',
							data: name1
						},
						yAxis: {
							type: 'value'
						},
						series: [{
							data: value1,
							type: 'bar'
						}]
					};


					// 使用刚指定的配置项和数据显示图表。
					myChart1.setOption(option);
				};
			}
		});
	</script>
	</body>
</html>
